/*
* ============================================================================
*  Name        : cameraengineobserver.h
*  Part of     : Symbian/S60 Camera Wrapper
*  Description : Observer interface for camera engine
*  Version     : %version: 1 %
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*
* You are welcome to, but not required to, contribute any modifications that
* improve stability, usability and/or feature set of the library back to
* Symbian/S60 Camera Wrapper project, as long as binary compatibility is
* retained. See https://projects.forum.nokia.com/camerawrapper for more info.
* ============================================================================
*/

/** @file cameraengineobserver.h */

#ifndef __CCAMERAENGINEOBSERVER_H__
#define __CCAMERAENGINEOBSERVER_H__

// FORWARD DECLARATIONS
class CFbsBitmap;
class TECAMEvent;

/**
 * @enum TCameraEngineError
 * @brief Enumeration for camera engine error categories.
 */
enum TCameraEngineError
  {
  EErrReserve,
  EErrPowerOn,
  EErrViewFinderReady,
  EErrImageReady,
  EErrAutoFocusInit,
  EErrAutoFocusMode,
  EErrAutoFocusArea,
  EErrAutoFocusRange,
  EErrAutoFocusType,
  EErrOptimisedFocusComplete,  
  };
  
/** @class MCameraEngineObserver
  * @brief Camera engine observer interface (pure virtual)
  */
class MCameraEngineObserver
  {
public:

  /**
    * Camera is ready to use for capturing images.
    */
  virtual void MceoCameraReady() = 0;
  
  /**
    * Camera AF lens has attained optimal focus
    */
  virtual void MceoFocusComplete() = 0;
  
  /**
    * Captured data is ready - call CCameraEngine::ReleaseImageBuffer()
    * after processing/saving the data (typically, JPG-encoded image)
    * @param aData Pointer to a descriptor containing a frame of camera data.
    */
  virtual void MceoCapturedDataReady( TDesC8* aData ) = 0;
  
  /**
    * Captured bitmap is ready.
    * after processing/saving the image, call 
    * CCameraEngine::ReleaseImageBuffer() to free the bitmap.
    * @param aBitmap Pointer to an FBS bitmap containing a captured image.
    */  
  virtual void MceoCapturedBitmapReady( CFbsBitmap* aBitmap ) = 0;
  
  /**
    * A new viewfinder frame is ready.
    * after displaying the frame, call 
    * CCameraEngine::ReleaseViewFinderBuffer()
    * to free the bitmap.
    * @param aFrame Pointer to an FBS bitmap containing a viewfinder frame.
    */  
  virtual void MceoViewFinderFrameReady( CFbsBitmap& aFrame ) = 0;
  
   /**
    * Notifies clients about errors in camera engine.
    * @param aErrorType type (category) of error.
    * @see TCameraEngineError
    * @param aError Symbian system-wide error code.
    */
  virtual void MceoHandleError( TCameraEngineError aErrorType, TInt aError ) = 0;

   /**
    * Notifies client about other events not recognized by camera engine.
    * The default implementation is empty.
    * @param aEvent Camera event
    * @see MCameraObserver2::HandleEvent()
    */
  virtual void MceoHandleOtherEvent( const TECAMEvent& aEvent ) {}
  };

#endif // __CCAMERAENGINEOBSERVER_H__

// eof
